import React, { Component } from 'react'
import Live from './Live';

class Button extends Component {
    constructor (props) {
        super(props)
        this.state = {
            pcname: 'Windows',
            buttonInfo: 'Button',
        }
        
    }
    changePCname () {
        this.setState({
            pcname: 'Mac Book pro'
        });
    }
    cbFromLive (msg) {
        this.props.cbApp(msg)
    }
    render () {
        return (
            <div>
                <button className="btn btn-info" onClick={this.changePCname.bind(this)}>测试生命周期</button>
                <Live pcname={this.state.pcname} srcText={this.state.buttonInfo} handleEvent={this.cbFromLive.bind(this)}></Live>
            </div>
        )
    }
}

export default Button